/*******************************************************************************
 * @project: Java_Genericit
 * @package: com.burns.java.generic
 * @file: Test2.java
 * @author: Administrator
 * @created: 2017年5月16日
 * @purpose:
 * 
 * @version: 1.0
 * 
 * Revision History at the end of file.
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/

package com.burns.java.generic;

import java.util.ArrayList;
import java.util.List;

public class Test2 {
	public static void main(String[] args) {
		/*
		 * List list = new ArrayList(); list.add("qqyumidi"); list.add("corn");
		 * list.add(100);
		 */

		List<String> list = new ArrayList<String>();
		list.add("qqyumidi");
		list.add("corn");
//		 list.add(100); // 1 提示编译错误

		for (int i = 0; i < list.size(); i++) {
			String name = list.get(i); // 2
			System.out.println("name:" + name);
		}
	}

}

/*******************************************************************************
 * <B>Revision History</B><BR>
 * [type 'revision' and press Alt + / to insert revision block]<BR>
 * 
 * 
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/